/**
 * 
 */
var btnList, btnInput, btnModify, btnDelete;
var url = 'index.jsp?inc=./score/';
function general() {

	btnList = document.getElementById('btnList');
	if (btnList != null) {
		btnList.onclick = function() {
			var frm = document.hiddenfrm;
			frm.action = url + 'list.jsp';
			frm.submit();
		}
	}
	btnInput = document.getElementById('btnInput');
	if (btnInput != null) {
		btnInput.onclick = function() {
			var frm = document.hiddenfrm;
			frm.action = url + 'input.jsp';
			frm.submit();
		}
	}
	btnModify = document.getElementById('btnModify')
	if (btnModify != null) {
		btnModify.onclick = function() {
			var frm = document.hiddenfrm;
			frm.action = url + 'modify.jsp';
			frm.submit();
		}
	}
	btnDelete = document.getElementById('btnDelete');
	if (btnDelete != null) {
		btnDelete.onclick = function() {
			var b = confirm("정말 삭제하시겟습니까??");
			if (b) {
				var rno = document.hiddenFrm.rno.value;
				location.href = url + 'delete_result.jsp&rno=' + rno;
			} else {
				alert("삭제가 취소되었습니다.");
			}
		}
	}
	btnView = document.getElementById('btnView');
	if (btnView != null) {
		btnView.onclick = function() {

			location.href = url + 'view.jsp';
		}
	}
}
function goPage(page) {
	// location.href = url + 'view.jsp&page=' + page;
	// alert(page);
	var mf = document.hiddenfrm;
	mf.nowPage.value = page;
	mf.find.value = document.score_list_frm.find.value;
	mf.action = 'index.jsp?inc=./score/list.jsp';
	mf.submit();
}

function goView(page, rno) {

	var mf = document.hiddenfrm;
	mf.nowPage.value = page;
	mf.rno.value = rno;
	mf.find.value = document.score_list_frm.find.value;
	mf.action = 'index.jsp?inc=./score/view.jsp';
	mf.submit();
}

function inputInit() {
	general();
	document.getElementById('btnSave').onclick = function() {
		var f = document.hiddenfrm;
		if (f.mid.value == "") {
			alert("아이디를 입력하세요");
			f.mid.focus();
		} else {
			f.submit();
		}
	}
}
function modifyInit() {
	general();
	var f = document.hiddenfrm;
	document.getElementById("btnModify_result").onclick = function() {
		if (f.mid.value == "") {
			alert("아이디를 입력하세요");
			f.mid.focus();
		} else {
			f.submit();
		}
	}
}

function deleteInit() {
	general();
}
function viewInit() {
	general();
}
function listInit() {

	general();
}
